# -*- coding: utf-8 -*-

__author__ = 'parano1d'
__date__ = '07.07.2010 23:18:14'

import MySQLdb

class GestorDatabase:
    """Works with MySQL database"""

    __hostname = u'localhost'
    __username = u'root'
    __password = u'123'
    __database = u'gestor'

    def __init__(self):
        """Connects to database and creates cursor"""
        
        try:
            db = MySQLdb.connect(self.__hostname, self.__username, self.__password, self.__database)
        except:
            print u"Can't connect to database"
            self.connected = False
        else:
            self.cursor = db.cursor(MySQLdb.cursors.DictCursor)
            self.connected = True
